package ThreadDemo.Timer;

import java.util.*;


/**
 *
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-07-25
 * Time：23:01
 *
 */



public class TimerTest {

    public static void main(String[] args) {
        Timer timer = new Timer();


        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("schedule1 正在运行! ");
            }
        }, 1000);



        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("schedule2 正在运行! ");
            }
        }, 2000);



        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("schedule3 正在运行! ");
            }
        }, 3000);


        System.out.println("程序开始");


    }
}
